﻿<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/


// Route::when('Admin/*', 'admin');
Route::pattern('menu_id', '[0-9]+');
Route::pattern('bannerid', '[0-9]+');
Route::pattern('oid', '[0-9]+');
Route::pattern('catid', '[0-9]+');
Route::pattern('id', '[0-9]+');
Route::pattern('type', '[a-z]+');

Route::pattern('company_id', '[0-9]+');
Route::pattern('contentid', '[0-9]+');
Route::pattern('comment_id', '[0-9]+');
Route::pattern('job_id', '[0-9]+');

// Entrust::routeNeedsRole('admin/*', 'superadmin');

Route::get('/exam',function(){
        return view('front.exam');
    });
Route::get('/', 'Front\IndexController@index');
Route::post('/register','Auth\AuthController@postRegister');
Route::post('/login','Auth\AuthController@postLogin');
Route::get('/logout','Auth\AuthController@userLogout');
Route::controller('password','Auth\PasswordController');
Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login','Auth\AuthController@authenticate');
Route::get('auth/logout', 'Auth\AuthController@getLogout');

Route::get('/changeuser','Front\MasterController@changeUser'); //临时

Route::get("category","CategoryController@getChild");//根据父分类获取子分类
Route::get("companytype","CategoryController@getCompanyTtypeChild");//根据父分类获取子分类
Route::get("companyjobtype","CategoryController@getCompanyJobTtypeChild");//根据父分类获取子分类
Route::get('areas','AreaController@getChildAreas');//根据父地区获取所有的子地区列表
Route::post('articals','CategoryController@getArtical');//根据模块信息获取文章列表
Route::get('bbsplates','CategoryController@getBbsChild');
Route::post('upload/images',['middleware' => 'auth','uses' =>'UploadController@newsImages']);//上传图片
Route::post('upload/attach',['middleware' => 'auth','uses' =>'UploadController@attachment']);//上传 attment图片
Route::post('upload/logo',['middleware' => 'auth','uses' =>'UploadController@userLogo']);//用户头像上传
Route::post('upload/teaches',['middleware' => 'auth','uses' =>'UploadController@teaches']);//教程文件上传
Route::post('upload/bbs',['middleware' => 'auth','uses' =>'UploadController@bbsImg']);//社区图片上传
Route::post('upload/comimg',['middleware' => 'auth','uses' =>'UploadController@compImages']);//企业风采上传
Route::get('captcha','CaptchaController@index');
Route::get('notify','NotifyController@webNotify');
Route::get('sycreturn','NotifyController@webReturn');
Route::post('sendmsg','SmsController@sendSms');
Route::post('checkcode','SmsController@checkMsgCode');

Route::group(array('prefix' => 'admin','middleware' => 'auth', 'namespace' => 'Admin' ), function () {
    Route::get("index","IndexController@index");
    Route::get("employ","IndexController@index");
    Route::get("teaches","IndexController@index");
    Route::get("enterprise","IndexController@index");
    Route::get("bbs","IndexController@index");
    Route::get("users","IndexController@index");
    Route::get("content","IndexController@index");
    Route::get("setting","IndexController@index");
    /**********************************************  我的面板   **************************************************************************/
    Route::get("index/server","IndexController@index");
    Route::get('index/owner','IndexController@owner');
    Route::post('index/owner','IndexController@ownerSave');
    Route::get('index/modifypwd','IndexController@modifyPwd');
    Route::post('index/modifypwd','IndexController@modifyPwd');

    /**********************************************  文件上传   **************************************************************************/
    Route::post("upload/newsimage",'UploadController@newsImages');
    Route::post("upload/employimg",'UploadController@employImg');
    Route::post("upload/uploadimg",'UploadController@uploadImg');
    Route::post("upload/video",'UploadController@video');
    Route::post("upload/office",'UploadController@office');
    Route::post("upload/ppt",'UploadController@ppt');
    Route::post('upload/logo/{id}','UploadController@userLogo');
    /********************************************** 就业指南  *****************************************************************************/
    /******就业指南文章****/
    Route::resource("employ/index","EmployController",['except' => ['update']]);
    Route::post('employ/index/add','EmployController@add');
    Route::post('employ/index/recommond','EmployController@recommond');
    Route::get("employ/noverify","EmployController@noverify");
    Route::post('employ/index/validate',"EmployController@emploayValidate");
    Route::post('employ/index/import',  "EmployController@importExcel");
    Route::resource('employ/category','CategoryController');
    Route::get("employ/comment","CommentsController@employList");
    Route::post('employ/comment/delete','CommentsController@destroye');

    /********************************************** 充电加油  *****************************************************************************/
    Route::post('teaches/index/recommond','TeachesController@recommond');
    Route::post('teaches/index/hots','TeachesController@toHots');
    Route::get("teaches/noverify","TeachesController@noverify");
    Route::post('teaches/index/validate',"TeachesController@teachesValidate");
    Route::post('teaches/index/chapter/add','TeachesController@chapterAdd');
    Route::get('teaches/index/chapter/{id}','TeachesController@chapterList');
    Route::delete('teaches/index/chapter/{id}','TeachesController@chapterDel');
    Route::resource('teaches/index','TeachesController',['except' => ['update']]); //职业技能 课程
    Route::get("teaches/compverify","TeachesCompanyController@noverify");

    Route::resource('teaches/enterprise/validate','TeachesCompanyController@teachesValidate');  //企业专区相关路由
    Route::resource('teaches/enterprise','TeachesCompanyController');  //企业专区相关路由
    Route::post('teaches/enterprise/recommond','TeachesCompanyController@recommond');//推荐至首页
    Route::resource('teaches/company','TeachesEnterpriseController',['except' => ['edit', 'update', 'destroy','store','create']]);

    Route::resource('teaches/index/course','TeachesContentController',['except' => ['index','update','show']]);  //教程
    Route::get('teaches/index/course/index/{id}','TeachesContentController@index');//教程

    Route::resource("teaches/category","CategoryController");//充电加油分类
    Route::get("teaches/comment","CommentsController@teachesList");//评论
    Route::post('teaches/comment/delete','CommentsController@destroyt');


    //推荐机构
    Route::resource('teaches/organization/category', 'CategoryController');
    Route::resource('teaches/organization/index', 'OrganizationController');
    Route::post('teaches/organization/index/export', 'OrganizationController@exportexcel');
    Route::resource('teaches/organization/class', 'CourseController',['except' => ['update']]);
    Route::post('teaches/organization/class/update', 'CourseController@update');
    Route::resource('teaches/class/comment', 'CourseScoreController@index',['except' => ['update','edit','create']]);
    Route::post('teaches/class/comment/delete','CourseScoreController@destroy');
    Route::post('organization/course/query', 'CourseScoreController@query');
    /**********************************************  青苜社区   *****************************************************************************/
    Route::resource('bbs/category','BbsCategoryController');
    Route::post('bbs/category/hot','BbsCategoryController@hotCates');
    /*bbs的问题路由定义*/
    Route::get('bbs/questions/index','BbsQuestionsController@questionsList');
    Route::post('bbs/questions/delete','BbsQuestionsController@destroy');
    Route::post('bbs/questions/deletes','BbsQuestionsController@deletes');
    Route::post('bbs/question/recomment','BbsQuestionsController@recomment');
    Route::resource('bbs/top','BbsTopController');
    /*bbs的答案路由定义*/
    Route::get('bbs/answers/index','BbsAnswerController@answerList');
    Route::post('bbs/answers/delete','BbsAnswerController@destroy');
    Route::post('bbs/answers/deletes','BbsAnswerController@deletes');
    Route::get('bbs/answers/show/{id}','BbsAnswerController@show');

    Route::get('bbs/category/add','BbsCategoryController@categoryAdd');
    Route::get('bbs/category/edit','BbsCategoryController@categoryEdit');
    Route::post('bbs/category/save','BbsCategoryController@categorySave');
    Route::post('bbs/category/delete','BbsCategoryController@categoryDel');
    Route::get('bbs/content','SettingController@getContent');
    Route::post('bbs/content','SettingController@postContent');
    Route::get('bbs/permission','SettingController@getPermission');
    Route::post('bbs/permission','SettingController@postPermission');
    /*bbs的答案评论路由定义*/
    Route::get('bbs/comments/index','BbsAnswerCommentController@index');
    Route::get('bbs/comments/create','BbsAnswerCommentController@create');
    Route::post('bbs/comments/save','BbsAnswerCommentController@store');
    Route::post('bbs/comments/delete','BbsAnswerCommentController@destroy');
    Route::post('bbs/comments/deletes','BbsAnswerCommentController@deletes');
    /**********************************************  系统设置路由定义开始   **************************************************************************/
    Route::resource('setting/admin','AdminController');
    Route::resource('setting/roles','RolesController');
    Route::resource('setting/menu','SiteMenuController');
    Route::get('sitemenu','SiteMenuController@childSiteMenus');
    Route::get('setting/datas/forum','AdminPlateController@index');
    Route::get('setting/datas/forum/edit/{id}','AdminPlateController@edit');
    Route::post('setting/datas/forum/save','AdminPlateController@save');
    /**********************************************  内容管理   **************************************************************************/
    Route::get('content/info','SettingController@getContent');
    Route::post('content/info','SettingController@postContent');
    Route::resource('content/banner','BannersController');
    Route::resource('content/module','ModuleController',['except' => ['update','show']]);
    Route::get('content/area','AreaController@index');
    Route::post('content/area/hot','AreaController@hotCates');
    /*广告位管理路由定义*/
    Route::resource('content/position', 'AdsPositionController');
    Route::post('content/position/disabled', 'AdsPositionController@updateStatus');
    Route::resource('content/ads', 'AdsController');
    /*友情链接*/
    Route::resource('content/link', 'LinkController');
    Route::post('content/link/disabled', 'LinkController@updateStatus');
    /*新闻*/
    Route::resource('content/news', 'NewsController');

    /********************************************** 企业招聘路由定义开始   **************************************************************************/
    Route::resource('enterprise/companys','CompanyController');  //企业相关路由
    Route::resource('enterprise/companys/import','CompanyController@import');  //批量导入
    Route::post('enterprise/companys/teachesed','CompanyController@companyTeaches');//推荐至充电加油
    Route::get('enterprise/noverify','CompanyController@noverify');//未审核企业
    Route::post('enterprise/companys/validated','CompanyController@companyValidate');//企业审核
    Route::resource('enterprise/jobs/index','CompanyJobsController',['except' => [ 'update']]);  //职位相关路由
    Route::get('enterprise/jobs/index/exams/{id}','CompanyJobsController@getExams');
    Route::get('enterprise/jobs/noverify','CompanyJobsController@notAudit');                //未审核的职位列表
    Route::post('enterprise/jobs/validated','CompanyJobsController@jobsValidate');//职位审核
    Route::resource('enterprise/pictures','CompanyPhotoController',['only' => ['index', 'destroy']]);//企业图库路由，包含列表和删除
    Route::post('enterprise/pictures/delete', 'CompanyPhotoController@destroy');
    Route::resource('enterprise/users','CompanyUsersController',['except' => [ 'update']]); //企业账户相关路由
    Route::post('enterprise/users/status', 'CompanyUsersController@updateStatus');
    /*评论管理路由定义*/
    Route::get('enterprise/comments', 'CompanyCommentController@index');
    Route::post('enterprise/comment/delete', 'CompanyCommentController@destroy');
    Route::post('enterprise/comment/deletes', 'CompanyCommentController@batchDelete');
    /*投递管理路由定义*/
    Route::get('enterprise/folder', 'CompanyFolderController@index');
    Route::post('enterprise/folder/delete', 'CompanyFolderController@destroy');
    Route::post('enterprise/folder/deletes', 'CompanyFolderController@batchDelete');
    /*企业人才库路由定义*/
    Route::get('enterprise/inbox', 'CompanyInboxController@index');
    Route::post('enterprise/inbox/delete', 'CompanyInboxController@destroy');
    Route::post('enterprise/inbox/deletes', 'CompanyInboxController@batchDelete');
    /*行业类型路由定义*/
    Route::resource('enterprise/company_type', 'CompanyTypeController');
    /*职位类型路由定义*/
    Route::resource('enterprise/job_type','CompanyJobsTypeController');
    Route::post('enterprise/job_type/recommond','CompanyJobsTypeController@recommond');
    Route::post('enterprise/job_type/childrens/{id}','CompanyJobsTypeController@childrens');
    /*企业规模路由定义*/
    Route::resource('enterprise/company_scale', 'CompanyScaleController@index');
    /*企业发展阶段路由定义*/
    Route::resource('enterprise/company_develop', 'CompanyDevelopController');
    /*企业认证类别路由定义*/
    Route::resource('enterprise/auth_type', 'CompanyAuthController');
    Route::post('enterprise/auth_type/view', 'CompanyAuthController@iconPath');
    Route::post('enterprise/auth_type/viewInfo', 'CompanyAuthController@brief');
    /*企业认证路由定义*/
    Route::get('enterprise/company_auth', 'CompanyAuthInfoController@index');
    Route::post('enterprise/company_auth/viewID', 'CompanyAuthInfoController@viewID');
    Route::post('enterprise/company_auth/viewPermits', 'CompanyAuthInfoController@viewPermits');
    Route::post('enterprise/company_auth/status', 'CompanyAuthInfoController@changeStatus');
    Route::post('enterprise/company_auth/reson', 'CompanyAuthInfoController@store');
    Route::post('enterprise/company_auth/viewReson', 'CompanyAuthInfoController@getReson');
    /*题库管理路由器*/
    Route::resource('enterprise/questions', 'QuestionsController');
    /*试卷路由器*/
    Route::resource('enterprise/examinations', 'ExaminationsController',['except' => [ 'update']]);
    /*考试记录路由定义*/
    Route::get('enterprise/test_record', 'UserExamHistoryController@index');
    Route::post('enterprise/company_auth/viewID', 'CompanyAuthInfoController@viewID');
    Route::post('enterprise/company_auth/viewPermits', 'CompanyAuthInfoController@viewPermits');
    Route::post('enterprise/company_auth/status', 'CompanyAuthInfoController@changeStatus');
    Route::post('enterprise/company_auth/reson', 'CompanyAuthInfoController@store');
    Route::post('enterprise/company_auth/viewReson', 'CompanyAuthInfoController@getReson');
    /*用户管理路由定义开始*/
    Route::resource('users/users','UsersController',['except' => ['update']]); //用户列表
    Route::post('users/users/status','Userscontroller@updateStatus');   //改变用户状态。异步请求
    Route::get('users/resumeview/{id}', 'UserResumeController@show'); //用户中心简历查看
    Route::resource('users/resume','UserResumeController');   //用户简历
    Route::resource('users/restatus','UserResumeStatusController',['except' => ['update','destory']]); //简历状态
    Route::get('users/consume','UserConsumeController@index');  //用户消费记录
    Route::get('users/charge','UserConsumeController@charge');  //充值记录
    Route::get('users/points','UserConsumeController@jifen');   //积分流水
    Route::get('users/message', 'UserInboxController@index');   //私信
    Route::post('users/message/delete', 'UserInboxController@destroy'); //私信删除
    Route::post('users/message/deletes','UserInboxController@deletes'); //私信批量删除
    /*举报管理路由器*/
    Route::get('users/report', 'UserReportController@index');
    Route::post('users/report/delete', 'UserReportController@destroy');
    Route::post('users/report/deletes','UserReportController@deletes');

});


/**************************************************用户中心****************************************************/
Route::group(array('prefix' => 'member','middleware' => 'auth', 'namespace' => 'Member' ), function () {
    Route::resource('/index','EmployController',['except'=>['edit','update']]);       //我的文档 充电加油
    Route::resource('/teaches','TeachesController',['except'=>['show','edit','update']]);    //我的文档 就业指南
    Route::resource('/course','StudyController',['except'=>['show','create','edit','update']]); //我的课程
    Route::resource('/collect','CollectController',['except'=>['index','show','create','edit','update']]); //我的收藏
    Route::get('/collect/index','CollectController@index');
    Route::get('/collect/teaches','CollectController@teaches');
    Route::get('/collect/company','CollectController@company');
    Route::get('/collect/jobs','CollectController@jobs');
    Route::get('collect/bbs','CollectController@bbs');
    Route::resource('/resume','ResumeController',['except'=>['show','create','edit','update']]);
    Route::resource('/delivery','DeliveryController');//我的简历 职位投递
    Route::resource('/question','QuestionController',['except'=>['show','update']]);//我的问答 我的提问
    Route::resource('/answer','AnswerController',['except'=>['show','update']]);//我的问答 我的提问
    Route::resource('/account','AccountController',['except'=>['update']]); //我的账户
    Route::get('/setting','AccountController@setting');
    Route::get('/email','AccountController@email');
    Route::get('/password','AccountController@password');
    Route::get('/check','AccountController@check');
    Route::resource('/message','MessageController',['except'=>['update','create','edit']]);//所有私信
    Route::get('/noread','MessageController@noRead');
    Route::get('/comments/index','CommentController@index'); //就业指南评论
    Route::get('/comments/teaches','CommentController@teaches');
    Route::get('/comments/course','CommentController@course');
    Route::get('/comments/company','CommentController@company');

    //Route::get('/subscribe','MemberController@subscribe');//我的简历 我的订阅
    Route::get('/exam','ExaminationController@index');//我的考试
    Route::get('/fromenterprise','ResumeCommentController@index');//我的信用 来自企业的评价
    Route::get('/toenterprise','ResumeCommentController@toEnterprise');//我的信用 给企业的评价
    Route::get('/report','ReportController@index');//我的投诉 收到的投诉
    Route::get('/myreport','ReportController@myreport');//我的投诉
    Route::post('/report','ReportController@store');

    Route::post('user','ResumeController@saveUsername');
    Route::post('experience','ResumeController@experiencen');
    Route::post('educational','ResumeController@educational');
    Route::post('projects','ResumeController@projects');
    Route::post('other','ResumeController@other');
    Route::post('examination/resume','ExaminationController@store');
    Route::post('examination/employ','ExaminationController@employ');
    Route::post('delive/resume','ExaminationController@resume');

    Route::controller('recharge','RechargeController');
//     Route::get('/recharge','RechargeController@index');//充值
//     Route::post('/ebank','RechargeController@paybank');//充值
//     Route::get('/success','RechargeController@suc');//充值
//     Route::get('/fail','RechargeController@fail');//充值


});
/**************************************************企业中心****************************************************/
Route::group(array('prefix' => '/company/center','middleware' => 'auth', 'namespace' => 'Company' ), function () {
    Route::get('/', 'CompanyController@index'); //企业中心首页
    Route::get('/jobsmanage', 'JobsController@jobs'); //企业中心发布职位
    Route::post('/jobs/save', 'JobsController@savejobs');
    Route::get('/jobs-{type}', 'JobsController@joblist'); //企业中心职位列表
    Route::get('/status', 'JobsController@changestatus'); //企业中心职位状态改变
    Route::resource('/exams','ExaminationController',['except'=>['update','edit']]);  //试卷管理
    Route::get('/ehistory','ExaminationController@history');
    Route::resource('/questions','QuestionController',['except'=>['update','edit']]);  //试题管理
    Route::get('/resume-{type}', 'ResumeController@resume'); //企业中心简历管理
    Route::post('/resume/status/{id}','ResumeController@resumeStatus');
    Route::post('/resume/comment','ResumeController@resumeComment');
    Route::get('/resumeview/{id}', 'ResumeController@resumeview'); //企业中心简历查看

    Route::get('/comments-{type}', 'CommentsController@commentlist');//企业中心评论
    Route::get('/comments/replyhtml-{company_id}-{comment_id}-{job_id}', 'CommentsController@reatehtml');//企业中心评论
    Route::post('/reply', 'CommentsController@reply');//企业中心评论

    Route::resource('/message', 'MessageController');//企业中心私信
    Route::get('/nomessage','MessageController@noreplay');
    Route::get('/companyinfo-{type}', 'InfoController@companyinfo');//企业中心资料
    Route::post('/company/save','InfoController@store');
    Route::post('/company/del','InfoController@destroy');
    Route::post('/company/othersave','InfoController@moreinfoSave');
    Route::get('/company/check','InfoController@check');
    Route::get('/account-email', 'AccountController@index');//企业中心账号设置
    Route::get('/account-password', 'AccountController@accountPassword');//企业中心账号设置
    Route::resource('/document','TeachesController');
});


/**************************************前台路由定义***********************************************************/
Route::group(array('prefix' => '', 'namespace' => 'Front' ), function () {
    Route::post('approve','MasterController@toApprove');
    /********************************************** 青苜社区路由定义开始  **************************************************************************/
    Route::get('/bbs','BbsController@index');
    Route::post('/bbs',['middleware' => 'auth','uses' =>'BbsController@store']); //发布帖子
    Route::get('/bbs/board/{id}','BbsController@board'); //板块列表
    Route::get('/bbs/board/refresh','BbsController@refresh'); //板块刷新
    Route::get('/bbs/{id}','BbsController@show');
    Route::get('/bbs/post/',['middleware' => 'auth','uses' =>'BbsController@posting']);
    Route::post('/bbs/praise','BbsController@praise');  //点赞
    Route::post('/bbs/follow','BbsController@attention'); //关注

    /**********************************************前台的就业指南路由定义************************************/
    Route::get('/employ/list','EmployController@employList');   //列表
    Route::get('/employ/contribute','EmployController@contribute'); //投稿
    Route::post('/employ/comment','EmployController@comment'); //获取更多 列表
    Route::resource('/employ','EmployController',['except' => ['update','destory']]);  //首页、详情、发布、更新等

    /*********************************************企业招聘***********************************************************/
    Route::get('/company','CompanyController@index');
    Route::post('/company/hotjobs','CompanyController@moreJobs');
    Route::post('/company/hotcompanys','CompanyController@moreCompanys');
    Route::get('/company/list','CompanyController@lists'); //企业列表 职位列表
    Route::get('/company/detail','CompanyController@details'); //企业详情 职位详情
    Route::get('/map','CompanyController@baidumap');

    /*********************************************企业招聘***********************************************************/
    Route::post('/comment/push','CommentController@comment'); //发布评论

    /*********************************************私信***********************************************************/
    Route::post('/message','MessageController@show');//私信
    Route::post('/message/save','MessageController@store');//私信

    /*********************************************底部内容***********************************************************/
    Route::get('/content/about','ContentController@about');  //关于我们
    Route::get('/content/join','ContentController@join');   //合作加盟
    Route::get('/content/contact','ContentController@contact'); //联系我们
    Route::get('/content/links','ContentController@links');   //友情链接
    Route::get('/content/news','ContentController@news');   //新闻
    Route::get('/content/news/{id}','ContentController@newsdetail');   //新闻详情

    /***********************************************充电加油站路由定义开始***********************************/
    Route::get('/teaches/list/{id}','TeachesController@teachesList');     //企业专区 列表
    Route::get('/teaches/organization/{id}','TeachesController@organization');  //推荐机构详情
    Route::get('/teaches/orgcourse/{id}','TeachesController@recommend');   //推荐课程内容详情页
    Route::get('/teaches/company/{id}','TeachesController@companyDetail');  //企业专区 详情
    Route::get('/teaches/company/show/{id}','TeachesController@companyShow'); // 企业内训详情companyShow
    // Route::post('/teaches/study/info','TeachesController@study');
   // teaches/study?teachesid=49&contentid=0&_token=FXa47LHrCEW8BfqiqVSVyA0jlVSOQ22ukrfkWAaZ HTTP
//     Route::post('/teaches/content','TeachesController@conShow');
//     Route::get('/teaches/content/show','TeachesController@gContent');

    Route::resource('/teaches','TeachesController',['except' => ['update']]);              //首页
    Route::get('/tmap','TeachesController@baidumap');    //查看地图
    Route::post('/teachescom/next','TeachesController@moreCompanys'); //企业详情内训列表的下一组
    
//     Route::post('/video','StudyController@videoSee'); //观看视频
    Route::get('/teaches/study/{id}/{contentid}','StudyController@studyTeaches');
    Route::post('/teaches/content','StudyController@checkTeaches');

    /***********************************************注册协议***********************************/
    Route::get('/accord','AccordController@index');
    Route::post('/reports','AccordController@report');
});
